<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>最近一周接口访问量</title>
        <h1>单日历史峰值：<?php echo $this->max; ?></h1>
        <script type="text/javascript" src="/js/echarts.min.js"></script>
    </head>
    <body>
    <div id="main" style="width: 1200px;height:600px;"></div>
    <script type="text/javascript">
        var myChart = echarts.init(document.getElementById('main'));

        var option = {
            title: {
                text: '最近一周接口访问量'
            },
            tooltip: {},
            legend: {
                data:['访问量']
            },
            xAxis: {
            	data: [<?php foreach($this->dataLength as $date): ?><?php echo '"'. $date .'",'; ?><?php endforeach; ?>]
            },
            yAxis: {},
            series: [{
                name: '访问量',
                type: 'bar',
                data: [<?php foreach($this->result as $val): ?><?php echo '"'. $val['count'] .'",'; ?><?php endforeach; ?>]
            }]
        };

        myChart.setOption(option);
    </script>
    </body>
</html>